package com.yunji.common.enums.business;

import lombok.Getter;

import java.util.Objects;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.user.enums
 * @Title: StatsType
 *
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-09-09 09:42:06      V1.0        HuaAo       新建类
 */

@Getter
public enum  StatsType {

    DAY(0,"按天统计"),
    MONTH(1,"按月统计"),
    YEAR(2,"按年统计");

    StatsType(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    private final Integer code;

    private final String text;

    public static String get(Integer code)
    {
        StatsType[] enums = StatsType.values();
        for (StatsType e: enums )
        {
            if (Objects.equals(e.code, code)) { return e.text; }
        }
        return null;
    }
}